<div style="width:600px; height:550px; margin-left:30px; background-color:#fff;">
  <div id="pages" style="width:560px; padding:15px 20px 20px;">
    <form id="form-invoice" method="post" action="<?php e($this->base); ?>/orders/update">
      <div style="border:1px solid #ccc; padding:10px; margin-bottom:20px;">
        <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center">
          <tr>
            <td width="50%" valign="top">
              <div style="font-weight:bold;"><?php __('Order ID'); ?></div>
              <div>#<?php e($data['Order']['id']); ?></div>

              <div style="font-weight:bold; margin-top:10px;"><?php __('E-Mail'); ?></div>
              <div><?php e($data['Order']['email']); ?></div>

              <div style="font-weight:bold; margin-top:10px;"><?php __('Telephone'); ?></div>
              <div><?php e($data['Order']['telephone']); ?></div>

              <div style="font-weight:bold; margin-top:10px;"><?php __('Payment Method'); ?></div>
              <div><?php e($data['Order']['payment_method']); ?></div>
            </td>
            <td width="50%" valign="top">
              <div style="margin:1px 0 3px; font-weight:bold;"><?php __('Shipping Address'); ?></div>
              <div><?php e(nl2br($data['Order']['address'])); ?></div>
              <div><?php e($data['Order']['city'].', '.$data['Order']['zone']); ?></div>
              <div><?php e($data['Order']['country']); ?></div>
            </td>
          </tr>
        </table>
      </div>

      <div style="border:1px solid #ccc; padding:10px; margin-bottom:20px;">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
          <tr>
            <td><strong><?php __('Product'); ?></strong></td>
            <td align="right"><strong><?php __('Quantity'); ?></strong></td>
            <td align="right"><strong><?php __('Unit Price'); ?></strong></td>
            <td align="right"><strong><?php __('Total'); ?></strong></td>
          </tr>
<?php     $total = 0;
          foreach ($data['OrderProduct'] as $c) { ?>
          <tr>
            <td><?php e($c['name']); ?></td>
            <td align="right"><?php e($c['quantity']); ?></td>
            <td align="right"><?php e($c['price']); ?></td>
            <td align="right"><?php e(number_format($c['quantity'] * $c['price'], 2)); ?></td>
          </tr>
<?php     } ?>
          <tr>
            <td colspan="4" align="right" style="padding-top:20px;"><?php __('Sub-Total'); ?>: RM<?php e($data['Order']['total']); ?></td>
          </tr>
          <tr>
            <td colspan="4" align="right"><?php __('Shipping'); ?>: RM<?php e($data['Order']['shipping']); ?></td>
          </tr>
          <tr>
            <td colspan="4" align="right"><?php __('Total'); ?>: RM<?php e(number_format($data['Order']['total']+$data['Order']['shipping'], 2)); ?></td>
          </tr>
        </table>
      </div>

      <h3 style="margin-bottom:3px;"><?php __('Your Comment'); ?></h3>
      <div style="border:1px solid #ccc; padding:10px;"><?php e(nl2br($data['Order']['comment'])); ?></div>
<?php if (is_array($data['OrderHistory']) && count($data['OrderHistory'])>0) { ?>
      <h3 style="margin-bottom:3px;"><?php __('Order History'); ?></h3>
      <div style="border:1px solid #ccc; padding:10px;">
        <table width="100%">
          <tr>
            <th align="left"><?php __('Date Added'); ?></th>
            <th align="left"><?php __('Status'); ?></th>
            <th align="left"><?php __('Comments'); ?></th>
          </tr>
<?php     foreach ($data['OrderHistory'] as $h) { ?>
          <tr>
            <td valign="top" style="padding-right:8px;"><?php e($h['created']); ?></td>
            <td valign="top" style="padding-right:8px;"><?php e($status[$h['status']]); ?></td>
            <td valign="top" style="padding-right:8px;"><?php e(nl2br($h['comment'])); ?></td>
          </tr>
<?php     } ?>
        </table>
      </div>
<?php } ?>
      <div class="clear">
<?php if ($admin) { ?>
        <table width="100%" cellpadding="3" cellspacing="0" border="0" style="margin-top:5px;">
          <tr>
            <td valign="top"><?php __('Status'); ?>:</td>
            <td valign="top">
              <select name="status">
                <option value="" selected></option>
<?php     foreach ($status as $k=>$v) { ?>
                <option value="<?php e($k); ?>"><?php e($v); ?></option>
<?php     } ?>
              </select>
            </td>
          </tr>
          <tr>
            <td valign="top"><?php __('Comment'); ?>:</td>
            <td valign="top"><textarea name="comment" rows="5" cols="40"></textarea></td>
          </tr>
        </table>
<?php } ?>
      </div>
      <div class="fLeft"><input type="button" value="<?php __('Back'); ?>" style="margin-top:20px; display:block;" onclick="history.go(-1);" /></div>
<?php if ($admin) { ?>
      <div class="fRight">
        <input type="hidden" name="id" value="<?php e($data['Order']['id']); ?>" />
        <input type="submit" value="<?php __('Update'); ?>" style="margin-top:20px; display:block;" />
      </div>
<?php } ?>
      <div class="clear"></div>
    </form>
  </div>
</div>